import request from '@/utils/request'
import { LoginSuccess, ReqGetUserInfo, PageObj } from '@/types/user'
export const reqLogin = (data: { mobile: string, code: string }) => request.post<LoginSuccess>('/v1_0/authorizations', data)
// 关注用户
export const reqSetFocus = (target: string) => request.post('/v1_0/user/followings', { target })
// 取消关注
export const reqDelFocus = (target: string) => request.delete(`/v1_0/user/followings/${target}`)
// 获取用户个人资料
export const reqGetUserInfo = () => request.get<ReqGetUserInfo>('v1_0/user/profile')
// 获取用户关注列表
export const reqGetUserFocus = (obj: PageObj) => request.get('v1_0/user/followings', obj as any)
// 获取用户粉丝列表
export const reqGetUserFans = () => request.get('v1_0/user/followings')
// 获取用户自己本人信息
export const reqGetUserMsg = () => request.get('v1_0/user')
// 更新头像
export const reqUpdatePhoto = (formData: FormData) => request.patch('v1_0/user/photo', formData)
// 更新用户资料
export const reqUpdateUser = (data: {
    name?: string,
    gender?: number,
    birthday?: string,
    intro?: string,
}) => request.patch('v1_0/user/profile', data)

